package com.karrysong.blog_springboot.service.impl;

import com.karrysong.blog_springboot.entity.RequestRecord;
import com.karrysong.blog_springboot.enums.ErrorCode;
import com.karrysong.blog_springboot.mapper.RecordMapper;
import com.karrysong.blog_springboot.service.RecordService;
import com.karrysong.blog_springboot.vo.Result;
import com.karrysong.blog_springboot.vo.params.RequestRecordParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName: RecordServiceImpl
 * @Author: KarrySong
 * @Date: 2022/8/27 10:41
 * @Description:
 */
@Service
public class RecordServiceImpl implements RecordService {

    @Autowired
    private RecordMapper recordMapper;

    @Override
    public Result insertRecord(RequestRecord requestRecord) {

        int res = recordMapper.insert(requestRecord);
        if (res > 0){
            return Result.success(null);
        }else {
            return Result.fail(ErrorCode.SYSTEM_RECORD_ERROR);
        }
    }

    @Override
    public Result searchRecord(RequestRecordParam param) {
        return null;
    }
}
